﻿<UserControl x:Class="openPDC.UI.UserControls.OutputStreamCurrentDeviceUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="350" d:DesignWidth="500" Background="Transparent"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:tsf="clr-namespace:GSF.TimeSeries.UI;assembly=GSF.TimeSeries.UI.WPF"
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls;assembly=GSF.TimeSeries.UI.WPF"
             xmlns:tsfBinding="clr-namespace:GSF.TimeSeries.UI.Binding;assembly=GSF.TimeSeries.UI">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel Orientation="Vertical">

        <tsf:TsfPopup x:Name="PopupAddMore" Placement="Center" Height="515" Topmost="False">

            <Border CornerRadius="5" BorderThickness="2" Background="White" BorderBrush="Blue">

                <StackPanel Orientation="Vertical" Margin="5">

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                        <TextBox x:Name="TextBoxSearch"/>
                        <Button Content="Search" Height="24" Click="ButtonSearch_Click" Margin="5,0,5,0"/>
                        <Button Content="Show All" Height="24" Click="ButtonShowAll_Click"/>

                    </StackPanel>

                    <sdk:DataGrid x:Name="DataGridAddDevices" Height="400" Width="450" SelectionUnit="Cell">

                        <sdk:DataGrid.Columns>

                            <sdk:DataGridCheckBoxColumn Width="*" Binding="{tsfBinding:Column Path=Enabled}" CellStyle="{StaticResource CenterAlignCellStyle}">
                                <sdk:DataGridCheckBoxColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <CheckBox Checked="CheckBoxAddMore_Checked" Unchecked="CheckBoxAddMore_Unchecked"/>
                                    </DataTemplate>
                                </sdk:DataGridCheckBoxColumn.HeaderTemplate>
                            </sdk:DataGridCheckBoxColumn>                            
                            <sdk:DataGridTextColumn Header="Acronym" Width="2*" Binding="{tsfBinding:Column Path=Acronym}" IsReadOnly="True"/>
                            <sdk:DataGridTextColumn Header="Name" Width="3*" Binding="{tsfBinding:Column Path=Name}" IsReadOnly="True"/>

                        </sdk:DataGrid.Columns>

                    </sdk:DataGrid>

                    <StackPanel Orientation="Horizontal">

                        <CheckBox x:Name="CheckBoxAddAnalogs" Content="Add Analogs" Margin="0,0,5,0"/>
                        <CheckBox x:Name="CheckBoxAddDigitals" Content="Add Digitals" />

                    </StackPanel>

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                        <Button Content="Close" Height="24" Click="ButtonCancel_Click" Margin="0,0,5,0"/>
                        <Button Content="Add Selected" Width="Auto" Height="24" Click="ButtonAddMore_Click" />

                    </StackPanel>

                </StackPanel>

            </Border>

        </tsf:TsfPopup>

        <sdk:DataGrid x:Name="DataGridCurrentDevices" Height="600" Width="500" SelectionUnit="Cell">
            
            <sdk:DataGrid.Columns>

                <sdk:DataGridCheckBoxColumn Width="*" Binding="{tsfBinding:Column Path=Selected}" CellStyle="{StaticResource CenterAlignCellStyle}">
                    <sdk:DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox Checked="CheckBoxAll_Checked" Unchecked="CheckBoxAll_Unchecked"/>
                        </DataTemplate>
                    </sdk:DataGridCheckBoxColumn.HeaderTemplate>
                </sdk:DataGridCheckBoxColumn>                
                <sdk:DataGridTextColumn Header="Acronym" Width="2*" Binding="{tsfBinding:Column Path=Acronym}" IsReadOnly="True"/>
                <sdk:DataGridTextColumn Header="Name" Width="3*" Binding="{tsfBinding:Column Path=Name}" IsReadOnly="True"/>

            </sdk:DataGrid.Columns>
            
        </sdk:DataGrid>
        
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            
            <Button Content="Delete Selected" Width="Auto" Height="24" Click="ButtonDelete_Click" Margin="0,0,5,0"/>
            <Button Content="Add More Devices" Width="Auto" Height="24" Click="ButtonAdd_Click"/>
            
        </StackPanel>
        
    </StackPanel>
 
</UserControl>
